<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node699.html" />
<link rel="prev" href="node697.html" />
<link rel="parent" href="node692.html" />
<link rel="next" href="node699.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>20.1.6.6 Tk Option Data Types</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="20.1.6.5 the Window Manager"
  href="node697.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="20.1.6 handy Reference"
  href="node692.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="20.1.6.7 bindings and Events"
  href="node699.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node697.html">20.1.6.5 The Window Manager</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node692.html">20.1.6 Handy Reference</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node699.html">20.1.6.7 Bindings and Events</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h3><a name="SECTION0022166000000000000000">
20.1.6.6 Tk Option Data Types</a>
</h3> 
<p>
<a id='l2h-4705' xml:id='l2h-4705'></a>

<p>
<dl>
<dt><strong>anchor</strong></dt>
<dd>Legal values are points of the compass: <code>"n"</code>,
<code>"ne"</code>, <code>"e"</code>, <code>"se"</code>, <code>"s"</code>,
<code>"sw"</code>, <code>"w"</code>, <code>"nw"</code>, and also
<code>"center"</code>.

<p>
</dd>
<dt><strong>bitmap</strong></dt>
<dd>There are eight built-in, named bitmaps: <code>'error'</code>, <code>'gray25'</code>,
<code>'gray50'</code>, <code>'hourglass'</code>, <code>'info'</code>, <code>'questhead'</code>,
<code>'question'</code>, <code>'warning'</code>.  To specify an X bitmap
filename, give the full path to the file, preceded with an <code>@</code>,
as in <code>"@/usr/contrib/bitmap/gumby.bit"</code>.

<p>
</dd>
<dt><strong>boolean</strong></dt>
<dd>You can pass integers 0 or 1 or the strings <code>"yes"</code> or <code>"no"</code> .

<p>
</dd>
<dt><strong>callback</strong></dt>
<dd>This is any Python function that takes no arguments.  For example: 
<div class="verbatim"><pre>
    def print_it():
            print "hi there"
    fred["command"] = print_it
</pre></div>

<p>
</dd>
<dt><strong>color</strong></dt>
<dd>Colors can be given as the names of X colors in the rgb.txt file,
or as strings representing RGB values in 4 bit: <code>"#RGB"</code>, 8
bit: <code>"#RRGGBB"</code>, 12 bit" <code>"#RRRGGGBBB"</code>, or 16 bit
<code>"#RRRRGGGGBBBB"</code> ranges, where R,G,B here represent any
legal hex digit.  See page 160 of Ousterhout's book for details.  

<p>
</dd>
<dt><strong>cursor</strong></dt>
<dd>The standard X cursor names from <span class="file">cursorfont.h</span> can be used,
without the <code>XC_</code> prefix.  For example to get a hand cursor
(<tt class="constant">XC_hand2</tt>), use the string <code>"hand2"</code>.  You can also
specify a bitmap and mask file of your own.  See page 179 of
Ousterhout's book.

<p>
</dd>
<dt><strong>distance</strong></dt>
<dd>Screen distances can be specified in either pixels or absolute
distances.  Pixels are given as numbers and absolute distances as
strings, with the trailing character denoting units: <code>c</code>
for centimetres, <code>i</code> for inches, <code>m</code> for millimetres,
<code>p</code> for printer's points.  For example, 3.5 inches is expressed
as <code>"3.5i"</code>.

<p>
</dd>
<dt><strong>font</strong></dt>
<dd>Tk uses a list font name format, such as <code>{courier 10 bold}</code>.
Font sizes with positive numbers are measured in points;
sizes with negative numbers are measured in pixels.

<p>
</dd>
<dt><strong>geometry</strong></dt>
<dd>This is a string of the form "<tt class="samp"><var>width</var>x<var>height</var></tt>", where
width and height are measured in pixels for most widgets (in
characters for widgets displaying text).  For example:
<code>fred["geometry"] = "200x100"</code>.

<p>
</dd>
<dt><strong>justify</strong></dt>
<dd>Legal values are the strings: <code>"left"</code>,
<code>"center"</code>, <code>"right"</code>, and <code>"fill"</code>.

<p>
</dd>
<dt><strong>region</strong></dt>
<dd>This is a string with four space-delimited elements, each of
which is a legal distance (see above).  For example: <code>"2 3 4
5"</code> and <code>"3i 2i 4.5i 2i"</code> and <code>"3c 2c 4c 10.43c"</code> 
are all legal regions.

<p>
</dd>
<dt><strong>relief</strong></dt>
<dd>Determines what the border style of a widget will be.  Legal
values are: <code>"raised"</code>, <code>"sunken"</code>,
<code>"flat"</code>, <code>"groove"</code>, and <code>"ridge"</code>.

<p>
</dd>
<dt><strong>scrollcommand</strong></dt>
<dd>This is almost always the <tt class="method">set()</tt> method of some scrollbar
widget, but can be any widget method that takes a single argument.  
Refer to the file <span class="file">Demo/tkinter/matt/canvas-with-scrollbars.py</span>
in the Python source distribution for an example.

<p>
</dd>
<dt><strong>wrap:</strong></dt>
<dd>Must be one of: <code>"none"</code>, <code>"char"</code>, or <code>"word"</code>.
</dd>
</dl>

<p>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="20.1.6.5 the Window Manager"
  href="node697.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="20.1.6 handy Reference"
  href="node692.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="20.1.6.7 bindings and Events"
  href="node699.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="node697.html">20.1.6.5 The Window Manager</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="node692.html">20.1.6 Handy Reference</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node699.html">20.1.6.7 Bindings and Events</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
